Why is this happening?

I am relatively new to dxl and I am real confused by my following code
 

Object object
 
for object in all current Module do
 
if level(object) == 1 then
{
    string s = object."Object Heading"
        string sub = "Section"
        int offset = null
        int length = null
        string cat = ""
        bool matchCase = false
        bool reverse = false
        section = ""
 
        if(findPlainText(s,sub,offset,length,matchCase,reverse))
        {
                i = offset + 1
                cat = "cat"
                print length(cat)
        }
}

 


Now obviously the code isn't going to be printing the length of "cat" when done but I have found that the length function is the source of my problem. What is printed above is "7cat" and I am stumped.

 


TheDrizzle - Fri Jun 17 15:32:53 EDT 2011

Re: Why is this happening?
TheDrizzle - Fri Jun 17 15:49:13 EDT 2011

Never mind I figured it out! The variable named length and the function length were interfering with each other.